/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 进料检验Entity
 * @author HOHD
 * @version 2020-12-16
 */
@Table(name="st_check_log", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="bill_no", attrName="billNo", label="单据号"),
		@Column(name="inventory_bill_detail_id", attrName="inventoryBillDetailId", label="采购入库单详情id"),

		@Column(name="bill_date", attrName="billDate", label="单据日期"),
		@Column(name="check_man_code", attrName="checkManCode", label="检验人编码"),
		@Column(name="check_man", attrName="checkMan", label="检验人"),
		@Column(name="bad_num", attrName="badNum", label="不良数"),
		@Column(name="check_state", attrName="checkState", label="检验状态"),
		@Column(name="supplier_id", attrName="supplierId", label="供应商"),
		@Column(name="source_bill_no", attrName="sourceBillNo", label="源单号"),
		@Column(name="material_name", attrName="materialName", label="物料名称", queryType=QueryType.LIKE),
		@Column(name="buy_number", attrName="buyNumber", label="采购数量"),
		@Column(name="wait_check_number", attrName="waitCheckNumber", label="待检数量"),
		@Column(name="check_type", attrName="checkType", label="检验方式"),
		@Column(name="send_number", attrName="sendNumber", label="送货数量"),
		@Column(name="stock_in_number", attrName="stockInNumber", label="允入数量"),
		@Column(name="batch_number", attrName="batchNumber", label="批次"),
		@Column(name="pack_type", attrName="packType", label="包装规格"),
		@Column(name="product_date", attrName="productDate", label="生产日期"),
		@Column(name="saved_type", attrName="savedType", label="保质期"),
		@Column(name="pass_date", attrName="passDate", label="过期日期"),
		@Column(name="product_maker", attrName="productMaker", label="生产厂家"),
		@Column(name="dept_code", attrName="deptCode", label="部门编码"),

		@Column(name="dept_name", attrName="deptName", label="部门", queryType=QueryType.LIKE),
		@Column(name="exception_desc", attrName="exceptionDesc", label="异常描述"),
		@Column(name="check_desc", attrName="checkDesc", label="检验描述"),
		@Column(name="primary_id", attrName="primaryId", label="检验描述"),
	}, orderBy="a.id DESC",joinTable = {
		@JoinTable(on ="supplier.id=a.supplier_id",type = Type.LEFT_JOIN,alias = "supplier",entity = StSupplierRecord.class,attrName = "supplier"),
		@JoinTable(on ="m.id=a.material_name",type = Type.LEFT_JOIN,alias = "m",entity = StMaterialRecord.class,attrName = "material"),
}
)
public class StCheckLog extends DataEntity<StCheckLog> {
	
	private static final long serialVersionUID = 1L;
	private String billNo;		// 单据号
	private String inventoryBillDetailId;
	private Date billDate;		// 单据日期
	private String checkManCode;		// 检验人编码
	private String checkMan;		// 检验人
	private Integer badNum;		// 不良数
	private Integer checkState;		// 检验状态
	private String supplierId;		// 供应商
	private StSupplierRecord supplier;		// 供应商
	private String sourceBillNo;		// 源单号
	private String materialName;		// 物料名称
	private StMaterialRecord material;		// 物料名称
	private Integer buyNumber;		// 采购数量
	private Double waitCheckNumber;		// 待检数量
	private Integer checkType;		// 检验方式
	private Double sendNumber;		// 送货数量
	private Integer stockInNumber;		// 允入数量
	private String batchNumber;		// 批次
	private String packType;		// 包装规格
	private Date productDate;		// 生产日期
	private Integer savedType;		// 保质期
	private Date passDate;		// 过期日期
	private Integer productMaker;		// 生产厂家
	private String deptCode;		// 部门编码
	private String deptName;		// 部门
	private String exceptionDesc;		// 异常描述
	private String checkDesc;		// 检验描述
	private List<StCheckLogDetail> stCheckLogDetailList = ListUtils.newArrayList();		// 子表列表

	private String primaryId;

	public String getPrimaryId() {
		return primaryId;
	}

	public void setPrimaryId(String primaryId) {
		this.primaryId = primaryId;
	}

	public StCheckLog() {
		this(null);
	}

	public StCheckLog(String id){
		super(id);
	}

	public StSupplierRecord getSupplier() {
		return supplier;
	}

	public void setSupplier(StSupplierRecord supplier) {
		this.supplier = supplier;
	}

	public StMaterialRecord getMaterial() {
		return material;
	}

	public void setMaterial(StMaterialRecord material) {
		this.material = material;
	}

	public String getInventoryBillDetailId() {
		return inventoryBillDetailId;
	}

	public void setInventoryBillDetailId(String inventoryBillDetailId) {
		this.inventoryBillDetailId = inventoryBillDetailId;
	}

	@Length(min=0, max=20, message="单据号长度不能超过 20 个字符")
	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBillDate() {
		return billDate;
	}

	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}
	
	@Length(min=0, max=20, message="检验人编码长度不能超过 20 个字符")
	public String getCheckManCode() {
		return checkManCode;
	}

	public void setCheckManCode(String checkManCode) {
		this.checkManCode = checkManCode;
	}
	
	@Length(min=0, max=5, message="检验人长度不能超过 5 个字符")
	public String getCheckMan() {
		return checkMan;
	}

	public void setCheckMan(String checkMan) {
		this.checkMan = checkMan;
	}
	
	public Integer getBadNum() {
		return badNum;
	}

	public void setBadNum(Integer badNum) {
		this.badNum = badNum;
	}
	
	public Integer getCheckState() {
		return checkState;
	}

	public void setCheckState(Integer checkState) {
		this.checkState = checkState;
	}
	
	@Length(min=0, max=36, message="供应商长度不能超过 36 个字符")
	public String getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(String supplierId) {
		this.supplierId = supplierId;
	}
	
	@Length(min=0, max=20, message="源单号长度不能超过 20 个字符")
	public String getSourceBillNo() {
		return sourceBillNo;
	}

	public void setSourceBillNo(String sourceBillNo) {
		this.sourceBillNo = sourceBillNo;
	}
	
	@Length(min=0, max=36, message="物料名称长度不能超过 36 个字符")
	public String getMaterialName() {
		return materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}
	
	public Integer getBuyNumber() {
		return buyNumber;
	}

	public void setBuyNumber(Integer buyNumber) {
		this.buyNumber = buyNumber;
	}
	
	public Double getWaitCheckNumber() {
		return waitCheckNumber;
	}

	public void setWaitCheckNumber(Double waitCheckNumber) {
		this.waitCheckNumber = waitCheckNumber;
	}
	
	public Integer getCheckType() {
		return checkType;
	}

	public void setCheckType(Integer checkType) {
		this.checkType = checkType;
	}
	
	public Double getSendNumber() {
		return sendNumber;
	}

	public void setSendNumber(Double sendNumber) {
		this.sendNumber = sendNumber;
	}
	
	public Integer getStockInNumber() {
		return stockInNumber;
	}

	public void setStockInNumber(Integer stockInNumber) {
		this.stockInNumber = stockInNumber;
	}
	
	@Length(min=0, max=20, message="批次长度不能超过 20 个字符")
	public String getBatchNumber() {
		return batchNumber;
	}

	public void setBatchNumber(String batchNumber) {
		this.batchNumber = batchNumber;
	}
	
	@Length(min=0, max=20, message="包装规格长度不能超过 20 个字符")
	public String getPackType() {
		return packType;
	}

	public void setPackType(String packType) {
		this.packType = packType;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getProductDate() {
		return productDate;
	}

	public void setProductDate(Date productDate) {
		this.productDate = productDate;
	}
	
	public Integer getSavedType() {
		return savedType;
	}

	public void setSavedType(Integer savedType) {
		this.savedType = savedType;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPassDate() {
		return passDate;
	}

	public void setPassDate(Date passDate) {
		this.passDate = passDate;
	}
	
	public Integer getProductMaker() {
		return productMaker;
	}

	public void setProductMaker(Integer productMaker) {
		this.productMaker = productMaker;
	}
	
	@Length(min=0, max=20, message="部门编码长度不能超过 20 个字符")
	public String getDeptCode() {
		return deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}
	
	@Length(min=0, max=20, message="部门长度不能超过 20 个字符")
	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	
	@Length(min=0, max=500, message="异常描述长度不能超过 500 个字符")
	public String getExceptionDesc() {
		return exceptionDesc;
	}

	public void setExceptionDesc(String exceptionDesc) {
		this.exceptionDesc = exceptionDesc;
	}
	
	@Length(min=0, max=500, message="检验描述长度不能超过 500 个字符")
	public String getCheckDesc() {
		return checkDesc;
	}

	public void setCheckDesc(String checkDesc) {
		this.checkDesc = checkDesc;
	}
	
	public List<StCheckLogDetail> getStCheckLogDetailList() {
		return stCheckLogDetailList;
	}

	public void setStCheckLogDetailList(List<StCheckLogDetail> stCheckLogDetailList) {
		this.stCheckLogDetailList = stCheckLogDetailList;
	}
	
}